﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>

        function getNum(){
            var kinds = null;
            var num = null;
            while(true){
                var kinds = Math.random()*10;
                if( kinds >= 1 && kinds < 5){
                    break;
                };
               
            };
            while(true){
                var num = Math.random()*100;
                if( num >= 1 && num < 14){
                    break;
                };
               
            };

            kinds = Math.floor(kinds) -1;
            num = Math.floor(num) -1;
            
            var arr =  [["♣1","♣2","♣3","♣4","♣5","♣6","♣7","♣8","♣9","♣10","♣11","♣12","♣13"],
            ["♠1","♠2","♠3","♠4","♠5","♠6","♠7","♠8","♠9","♠10","♠11","♠12","♠13"],
            ["♥1","♥2","♥3","♥4","♥5","♥6","♥7","♥8","♥9","♥10","♥11","♥12","♥13"],
            ["♦1","♦2","♦3","♦4","♦5","♦6","♦7","♦8","♦9","♦10","♦11","♦12","♦13"]];
    
            var card = arr[kinds][num];
            return card;

            
        }
        
        function getCard(){

            var card = getNum();
            var card2 = getNum();
            var card3 = getNum();
            while(card == card2){
                card2 = getNum();
            }
            while(card == card3 || card2 == card3){
                card3 = getNum();
            }
            return card+"  "+card2+"   "+card3;
            
        };
        
        document.write(getCard());
    </script>
</body>
</html>
